home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Open Transport / OT1.1.1 ß Developer Release / Open Transport SDK / Open Tpt Protocol Developer / Includes / OTSharedLibs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-19  |  3.4 KB  |  122 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OTSharedLibs.h
  3.  
  4.     Contains:    This file contains prototypes for helpful routines for loading
  5.                 shared libraries.
  6.  
  7.     Copyright:    © 1994-1996 by Apple Computer, Inc., all rights reserved.
  8.  
  9.  
  10. */
  11.  
  12. #ifndef __OTSHAREDLIBS__
  13. #define __OTSHAREDLIBS__
  14.  
  15. #ifndef __OPENTRANSPORT__
  16. #include <OpenTransport.h>
  17. #endif
  18.  
  19. /*******************************************************************************
  20. ** Declarations
  21. ********************************************************************************/
  22.  
  23. typedef struct CFragInitBlock    CFragInitBlock;
  24.  
  25. enum
  26. {
  27.     kOTGetDataSymbol    = 0,
  28.     kOTGetCodeSymbol    = 1,
  29.     kOTLoadNewCopy        = 2,
  30.     kOTLoadACopy        = 4,
  31.     kOTFindACopy        = 8,
  32.     kOTLibMask            = kOTLoadNewCopy | kOTLoadACopy | kOTFindACopy,
  33.     kOTLoadLibResident    = 0x20
  34. };
  35.  
  36. /*******************************************************************************
  37. ** Some CFM Tags
  38. ********************************************************************************/
  39.  
  40. #define kOTCFMTag                'otan'
  41.  
  42. #define kOTPortScannerCFMTag                kOTKernelPrefix "pScnr"
  43. #define kOTPseudoPortScannerCFMTag            kOTKernelPrefix "ppScnr"
  44. #define kOTCompatPortScannerCFMTag            kOTKernelPrefix "cpScnr"
  45. #define kOTConfiguratorCFMTag                kOTClientPrefix "cfigMkr"
  46.  
  47. /*
  48.  * A list of these structures is returned by the OTSearchForCFMLibrary routine.
  49.  * The list is created out of the data that is passed to the function
  50.  */
  51.  
  52. struct CFMLibraryInfo
  53. {
  54.     OTLink        link;                /* To link them all up on a list                    */
  55.     char*        libName;            /* "C" String which is fragment name                */
  56.     UInt8        intlName[4];        /* Pascal String which is internationalized name    */
  57. };
  58.  
  59. /*******************************************************************************
  60. ** Functions for dealing with CFM
  61. ********************************************************************************/
  62.  
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif
  66.  
  67.     typedef void*     (*OTAllocMemProcPtr)(size_t);
  68.     typedef void     (*OTFreeMemProcPtr)(void*);
  69.     
  70.     //
  71.     // Find CFM libraries of the specified kind and type
  72.     //
  73.     extern OSStatus    OTFindCFMLibraries(OSType libKind, const char* type, OTList* theList, OTAllocMemProcPtr);
  74.     //
  75.     // Load a CFM library by name
  76.     //
  77.     extern OSStatus    OTLoadCFMLibrary(const char* libName, UInt32* connID, UInt32 type);
  78.     //
  79.     // Load a CFM library and get a named pointer from it
  80.     //
  81.     extern void*    OTGetCFMPointer(const char* libName, const char* entryName, UInt32* connID, UInt32 type);
  82.     //
  83.     // Get a named pointer from a CFM library that's already loaded
  84.     //
  85.     extern void*    OTGetCFMSymbol(const char* entryName, UInt32 connID, UInt32 type);
  86.     //
  87.     // Release a connection to a CFM library
  88.     //
  89.     extern void        OTReleaseCFMConnection(UInt32* connID);
  90.     //
  91.     // Load an ASLM library
  92.     //
  93.     extern OSStatus    OTLoadASLMLibrary(const char* libName);
  94.     //
  95.     // Unload an ASLM library
  96.     //
  97.     extern void        OTUnloadASLMLibrary(const char* libName);
  98.  
  99. #if !GENERATING68K
  100.     //
  101.     // Used in a CFM InitProc, will hold the executable code, if applicable.
  102.     // This can also be the InitProc of the library
  103.     //
  104.     extern OSStatus    OTHoldThisCFMLibrary(CFragInitBlock*);
  105.     //
  106.     // Used in a CFM terminate proc, will unhold the executable code, if applicable.
  107.     // This can also be the terminate proc of the library
  108.     //
  109.     extern void        OTUnholdThisCFMLibrary(void);
  110. #endif
  111. /*
  112.  * This is an ASLM utility routine.  You can get it by including LibraryManagerUtilities.h, but since
  113.  * we only use a few ASLM utilities, we put the prototype here for convenience.
  114.  */
  115. void    UnloadUnusedLibraries(void);
  116.  
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120.  
  121. #endif
  122.